import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooReviewController } from '../../../controllers';
const uctooreviewRouter = new Router();
const reviewController = new uctooReviewController();

uctooreviewRouter.post('/add', requireUser, reviewController.add);
uctooreviewRouter.post('/edit', requireUser, rowLevelPermission('uctoo/review'), reviewController.edit);
uctooreviewRouter.post('/del', requireUser, rowLevelPermission('uctoo/review'), reviewController.delete);

//For getting review with permission control
uctooreviewRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/review'), reviewController.getSingle);
uctooreviewRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/review'), reviewController.getMany);
uctooreviewRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/review'), reviewController.getMany);

//#endregion AutoCreateCode
export default uctooreviewRouter;
